package com.example.zk.service.impl;

import com.example.zk.mapper.UserMapper;
import com.example.zk.model.User;
import com.example.zk.service.UserService;
import com.example.zk.vo.Grid;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;

/**
 * Created by it001 on 2018-12-19.
 */
@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;

    @Override
    public User find(Long userId) {
        return userMapper.get(userId);
    }

    //暂时 不取数据库
    @Override
    public Grid findList() {
        Grid crid = new Grid();
        crid.setRows(new ArrayList());
        crid.setTotal(100L);
        return crid;
    }

    @Override
    public User getUserByloginName(String loginName) {
        return userMapper.getUserByLoginId(loginName);
    }
}
